/** @file MainMenuGUIController.h
 *	@class MainMenuGUIController
 *  @brief Draws and updates the main menu GUI, and also takes player input
 */
#include "stdafx.h"

#ifndef _MainMenuGUIController_h_
#define _MainMenuGUIController_h_

#include "Controller.h"
#include "GUIController.h"
#include "PlayerAvatar.h"
#include "StateManager.h"
#include <string>
#include <CEGUI/CEGUI.h>
#include <CEGUI/RendererModules/Ogre/CEGUIOgreRenderer.h>

using namespace std;

/**
* @brief An enum for switching between different menu screens
*/
enum MenuScreens {
		SCREEN_MAIN,
		SCREEN_CREDITS,
		SCREEN_HELP
	};

class MainMenuState;
class StateManager;
class MainMenuGUIController : public GUIController {
public:
	/**
	* @brief The constructor 
	*/
	MainMenuGUIController(Model *model, Ogre::RenderWindow* window, string scheme, string layout);
	/**
	* @brief The destructor
	*/
	~MainMenuGUIController();
	/**
	* @brief The update method, calls the update method in GUIController as well
	*/
	bool update(float deltaTime);

private:

	/**
	* @brief Constructs the menu screen depending on the value of newScreen enum
	*/
	void makeGUILayout();

	/**
	* @brief Constructs the main menu layout if newScreen is SCREEN_MAIN
	*/
	void makeGUIMain(); 

	/**
	* @brief Constructs the optional credits screen (not used in demo) if screen is SCREEN_CREDITS
	*/
	void makeGUICredits(); 

	/**
	* @brief Constructs the help screen (not used in demo) if newScreen is SCREEN_HELP
	*/
	void makeGUIHelp();

	CEGUI::Window	*m_start,
					*m_replay,
					*m_addressBox,
					*m_quit;

	//enum MenuScreens;
	MenuScreens m_newScreen,
				 m_oldScreen;

	/**
	* This function is simply a wrapper for the quitGame method in StateManager, as event handlers such as these have CEGUI dependencies
	*/
	bool quitGame(const CEGUI::EventArgs &e);

	/**
	* This function is simply a wrapper for the method that loads GameState in StateManager, as event handlers such as these have CEGUI dependencies
	*/
	bool startGame(const CEGUI::EventArgs &e);

	/**
	* This function is simply a wrapper for the method that loads GameState in StateManager and sets replay true, as event handlers such as these have CEGUI dependencies
	*/
	bool replayGame(const CEGUI::EventArgs &e);

	CEGUI::WindowManager &m_wmgr;

	StateManager* m_stateManager;

	bool m_GUIMade;
	
};

#endif
